Communication device, control method for communication device, and program

ABSTRACT

A communication device capable of handling, even in the case where requests for provision of a service are received from a plurality of devices, the requests appropriately, is provided. 
     A communication device which provides a service to a service utilizing device which utilizes a service, determines whether or not the communication device is executing a service requested from the service utilizing device. In the case where it is determined that the communication device is executing the service, the communication device makes a response to the request with the contents of the response changed according to whether or not the service is able to be provided to a plurality of service utilizing devices.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of International Patent ApplicationNo. PCT/JP2014/050502, filed Jan. 15, 2014, which claims the benefit ofJapanese Patent Application No. 2013-012136, filed Jan. 25, 2013, bothof which are hereby incorporated by reference herein in their entirety.

TECHNICAL FIELD

The present invention relates to a communication device, a controlmethod for a communication device, and a program.

BACKGROUND ART

In recent years, there have been increasing cases where electronicdevices, such as digital cameras and printers, having a wireless LANstation function are connected to a wireless LAN and are used ascommunication devices. For example, Patent Literature 1 discloses amethod for providing a digital camera with a wireless LAN function andfacilitating image sharing.

Further, a standard called Wi-Fi Direct® has been established by Wi-FiAlliance. Wi-Fi Direct defines a protocol for determining whetherindividual electronic devices operate as a wireless LAN access point ora wireless LAN station. By executing the protocol, an electronic deviceoperating as a wireless LAN access point and an electronic deviceoperating as a wireless LAN station may be automatically determined. Theuse of Wi-Fi Direct eliminates the necessity of separately providing anaccess point, and electronic devices are able to directly communicatewith each other to execute various services (image sharing, printing,etc.), thereby improving the user-friendliness.

Furthermore, a function of searching for the content of a serviceprovided by a different device in an application layer (servicediscovery function) is defined as an optional function of Wi-Fi Direct.With the service discovery function, a user of an electronic device isable to know, before performing connection processing, information on aservice provided by an electronic device with which the electronicdevice the user is operating is to be connected, thereby improving theuser-friendliness.

CITATION LIST Patent Literature

PTL 1: Japanese Patent Laid-Open No. 2011-35768

However, in the case where a device which provides a service is not awireless LAN access point but is a wireless LAN station, there is aproblem that it is difficult for the device to provide the variousservices to a plurality of devices. Further, there may be some caseswhere a service is not allowed to be provided to a plurality of devicesat the same time.

Accordingly, an object of the present invention is to provide acommunication device capable of appropriately handling, even whenrequests for provision of a service are received from a plurality ofdevices, the requests.

SUMMARY OF INVENTION

In order to achieve the above-mentioned object, a communication deviceaccording to the present invention includes service providing means forproviding a service to a service utilizing device which utilizes aservice; determining means for determining whether or not thecommunication device is executing a service requested from the serviceutilizing device; and responding means for making, in a case where it isdetermined by the determining means that the communication device isexecuting the service, a response to the request with contents of theresponse changed according to whether or not the service is able to beprovided to a plurality of service utilizing devices.

Furthermore, in order to achieve the above-mentioned object, acommunication device according to the present invention includes serviceproviding means for providing a service to a service utilizing devicewhich utilizes a service; determining means for determining whether ornot the communication device is executing a service requested from theservice utilizing device; and responding means for making, in a casewhere it is determined by the determining means that the communicationdevice is executing the service, a response to the request with contentsof the response changed according to an instruction from a user.

In order to achieve the above-mentioned object, a communication devicecapable of wireless communication according to the present inventionincludes service providing means for performing wireless communicationwith a service utilizing device which utilizes a service and providing aservice; determining means for determining whether or not thecommunication device is executing a service requested from the serviceutilizing device; and responding means for making, in a case where it isdetermined by the determining means that the communication device isexecuting the service, a response to the request with contents of theresponse changed according to a role of the communication device in awireless layer.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 illustrates blocks forming a device.

FIG. 2 illustrates software functional blocks within the device.

FIG. 3 is a diagram illustrating an example of a network configurationto which the present invention is applied.

FIG. 4 illustrates a sequence among communication devices to which thepresent invention is applied.

FIG. 5 is a flowchart of a communication device according to a firstembodiment.

FIG. 6 is a flowchart of a communication device according to a secondembodiment.

FIG. 7 is a flowchart of a communication device according to a thirdembodiment.

DESCRIPTION OF EMBODIMENTS First Embodiment

Hereinafter, a communication device according to this embodiment will beexplained in detail with reference to the drawings. Although an examplein which a wireless LAN system conforming to IEEE 802.11 series is usedwill be explained below, a communication form is not necessarily limitedto the wireless LAN conforming to IEEE 802.11.

A hardware configuration in a case suitable for this embodiment will beexplained.

FIG. 1 is a block diagram illustrating an example of a configuration ofindividual devices described below according to an embodiment to whichthe present invention may be applied. 101 represents the entire device.102 represents a controller which controls the entire device byexecuting a control program stored in a storing unit 103. The controller102 includes one or more processors, such as CPUs or MPUs. Thecontroller 102 also performs setting control for a communicationparameter with a different device. 103 represents the storing unit whichstores the control program executed by the controller 102 and varioustypes of information including a communication parameter. Further, imagedata, files, and the like that have been generated in the communicationdevice or received from an external device may be stored in the storingunit 103. The storing unit 103 may be a memory of any type, such as aROM, a RAM, an HDD, or a flash memory. Various operations describedbelow are performed when the controller 102 executes the control programstored in the storing unit 103.

104 represents a wireless unit for performing wireless LAN communicationconforming to IEEE 802.11. 105 represents a display unit which performsvarious types of display. The display unit 105 has a function of beingcapable of outputting visually recognizable information, such as an LCDor an LED, or outputting sound, such as a speaker. The display unit 105has a function of outputting at least one of visual information andsound information.

107 represents an antenna control unit and 108 represents an antenna.The antenna control unit 107 controls the antenna 108 to transmit andreceive signals via wireless communication. 109 represents an operatingunit with which a user inputs various data or the like and operates thecommunication device. The operating unit 109 includes various buttons, atouch panel, and the like.

A service providing unit 110 has a function of providingapplication-level service information provided by the communicationdevice. For example, in the case where the communication device is aprinter, the service providing unit 110 provides a printing function,and in the case where the communication device is a digital camera, theservice providing unit 110 provides an image capturing function.

FIG. 1 is merely an example, and the communication device 101 may have ahardware configuration different from the hardware configurationillustrated in FIG. 1.

FIG. 2 is a block diagram illustrating an example of a configuration ofsoftware functional blocks which execute a communication controlfunction, which will be described below. 201 represents the entiresoftware functional blocks. 202 represents a Discovery control unitwhich controls an operation of search processing of searching for acommunication device with which the communication device is tocommunicate.

203 represents a GO Negotiation control unit. The GO Negotiation controlunit 203 performs control based on Wi-Fi Direct protocol specifications,and determines the role in a wireless layer, as to which one ofcommunication devices operates as a wireless LAN access point and whichone of the communication devices operates as a wireless LAN station. InWi-Fi Direct, a communication device that implements a wireless LANaccess point function is referred to as a P2P group owner (hereinafter,a GO), and a communication device that implements a wireless LAN stationfunction is referred to as a P2P client (hereinafter, a CL). In the caseof the GO or the wireless LAN access point, a wireless LAN access pointfunction control unit 211, which will be described later, is activated.In the case of the CL or the wireless LAN station, a wireless LANstation function control unit 210, which will be described later, isactivated. The protocol of GO Negotiation is determined based on Wi-FiDirect specifications. Since this is not a point of the presentinvention, explanation for this protocol will be omitted. In Wi-FiDirect, a network established by the GO is referred to as a P2P group.In this description, this network may be described as a P2P group. Inthis embodiment, this network and the P2P group are described as havingthe same meaning.

In this description, a group of the P2P group owner (GO), the P2P client(CL), and a communication device whose role has not been determined, arecollectively referred to as P2P devices.

204 represents a DHCP client control unit, and is activated when therole of the own communication device is defined as a wireless LANstation by the GO Negotiation control unit 203. 205 represents a DHCPserver control unit, and is activated when the role of the owncommunication device is defined as a wireless LAN access point by the GONegotiation control unit 203.

206 represents a WPS Enrollee control unit, and receives a communicationparameter necessary for wireless LAN communication from a different WPSRegistrar device. Similar to the DHCP client control unit 204, the WPSEnrollee control unit 206 operates when the role of the owncommunication device is a wireless LAN station. 207 represents a WPSRegistrar control unit, and provides a communication parameter necessaryfor wireless LAN communication to a different WPS Enrollee device.Similar to the DHCP server control unit 205, the WPS Registrar controlunit 207 operates when the role of the own communication device is awireless LAN access point. The communication parameter provided by theWPS Registrar is a parameter, such as an SSID serving as a networkidentifier, an encryption key, an encryption system, an authenticationkey, or an authentication system.

208 represents a wireless LAN packet receiving unit, and 209 representsa wireless LAN packet transmitting unit. The wireless LAN packettransmitting unit 209 and the wireless LAN packet receiving unit 208perform transmission and reception of any packets including acommunication protocol in a higher-order layer. 210 represents awireless LAN station function control unit. The wireless LAN stationfunction control unit 210 performs authentication/encryption processingor the like at the time when the own communication device operates as awireless LAN station, and takes part in a wireless network establishedby a device operating as a wireless LAN access point. 211 represents awireless LAN access point function control unit. The wireless LAN accesspoint function control unit 211 establishes a wireless network when theown communication device operates as a wireless LAN access pointfunction, and performs authentication/encryption processing, managementof a communication device with which the own communication devicecommunicates, and the like. Either one function of the wireless LANstation function control unit 210 and the wireless LAN access pointfunction control unit 211 may operate or both the functions may operateat the same time.

212 represents a packet routing control unit which performs bridging androuting of a communication packet when the wireless LAN access pointfunction control unit 211 is operating. 213 represents a data storingunit which stores and holds software itself, a wireless LAN parameter,and various tables including the above-mentioned DHCP address table andan ARP table.

214 represents a Service Discovery control unit which has a servicediscovery function specific to Wi-Fi Direct. With the service discoveryfunction, service information held by a communication device with whichthe own communication device communicates is received by transmittingand receiving an action frame defined by IEEE 802.11u. Specifically, theService Discovery control unit 214 transmits an SD Query and receives anSD Response as a response. Alternatively, the Service Discovery controlunit 214 receives an SD Query from a communication device with which theown communication device communicates, and transmits an SD Response as aresponse.

215 represents a P2P Invitation function control unit which controls anInvitation function defined by the Wi-Fi Direct standard. Since theInvitation function is defined in the Wi-Fi Direct specifications,explanation for the Invitation function will be omitted. The Invitationfunction is a function of causing a GO device or a CL device to urge aP2P device whose role has not been determined to be connected as a P2Pclient.

216 represents a service providing unit which provides a service of anapplication layer. Here, the application layer represents a serviceprovision layer in a higher-order layer equal to or higher than thefifth layer in an OSI reference model. That is, the service providingunit 216 provides, for example, a printing function (printing service),an image streaming function (moving image streaming service), a filetransfer function (file transfer service), and the like.

217 represents a service utilizing unit in an application layer. Theservice utilizing unit 217 utilizes a service provided by a serviceproviding unit in an application layer of an opposing device. That is,the service utilizing unit 217 has a function of transmitting a materialto be printed to a printing service providing device, a function oftransmitting a moving image to a digital display, and the like.

All the functional blocks illustrated in FIG. 2 are not necessarilyprovided by software. At least part of the functional blocks may beprovided by hardware. The individual functional blocks illustrated inFIG. 2 have a mutual relationship. Further, the individual functionalblocks illustrated in FIG. 2 are merely examples. A plurality offunctional blocks may constitute a functional block. Alternatively, anyfunctional block may be divided into blocks having different functions.

Furthermore, in this embodiment, a service in an application layer isimplemented by a device which provides the service and a device whichutilizes the service. For example, in the case of a printing service,which is an example of a service in an application layer, a printerserves as a service providing device. The printer receives print datatransmitted from a PC or the like and performs printing. In contrast, adevice such as a PC serves as a service utilizing device. The deviceserving as a service utilizing device generates print data, andtransmits the generated print data to the printer as a service providingdevice. Further, in the case of an image streaming service as an exampleof a service, a display device serves as a service providing device. Thedisplay device receives image data transmitted from a PC or the like anddisplays the received image data. In contrast, a device such as a PCserves as a service utilizing device. The device serving as a serviceutilizing device generates image data, and transmits the generated imagedata to the display device serving as a service providing device.

FIG. 3 is a diagram illustrating a communication device A 32(hereinafter, an STA-A), a communication device B 33 (hereinafter, anSTA-B), a communication device C 34 (hereinafter, an STA-C), and anetwork A 31 (hereinafter, a network A) including the STA-A, the STA-B,and the STA-C. All the devices have the configuration illustrated inFIGS. 1 and 2.

FIG. 4 is a schematic diagram illustrating an operation sequence amongthe devices.

In the example of FIG. 4, the STA-A operates as a service providingdevice, and the STA-B and the STA-C operate as service utilizingdevices.

In order to utilize a service, the STA-B transmits an inquiry signal forsearching for a communication device which provides the service (F401).The STA-A which has received the inquiry signal transmits a searchresponse signal to the STA-B (F402).

In order to recognize that the STA-A provides a desired service, theSTA-B performs connection processing in a wireless layer andpredetermined connection processing defined in the service (F403).Although an example in which connection processing in the wireless layeris performed after searching for a service is completed, is explained inthis embodiment, the connection processing in the wireless layer may beperformed in advance, and only service connection processing may beperformed in F403.

Further, the connection processing in the wireless layer is based on theWi-Fi Direct specifications mentioned above. That is, one of the STA-Aand the STA-B serves as a P2P group owner, the other one of the STA-Aand the STA-B serves as a P2P client, and the CL performs connection bytaking part in a wireless network established by the GO.

After the connection processing is completed, service processing isperformed between the STA-A and the STA-B (F404). Here, it is assumedthat during execution of the service, a service inquiry signal regardingthe service is transmitted from the STA-C, which is different from theSTA-B (F405).

The STA-A receives the service inquiry signal from the STA-C. However,since the STA-A is executing the service for the STA-B, the STA-Anotifies the STA-C that provision of the service to the STA-C is refused(F406). Specifically, the STA-A transmits a signal, such as Busy.

Here, as described later, in the case where the STA-A is able to providea service to a plurality of communication devices at the same time, asearch response signal indicating that the service is able to beprovided may be transmitted in F406.

In contrast, in the case where after the STA-A has completed theprovision of the service to the STA-B and a service inquiry signalregarding the service is transmitted again from the STA-C (F407), theSTA-A transmits a search response signal to the STA-C (F408).

FIG. 5 is a flowchart illustrating an operation of a communicationdevice according to this embodiment. Individual steps in the flowchartare performed when the controller 102 executes a program stored in thestoring unit 103.

In S501, a communication device waits to receive a service search signaltransmitted from a different communication device. If no service searchsignal is received, the communication device continues to wait for aservice search signal until a predetermined timer has expired. When aservice search signal is received in S501, the communication devicechecks for the contents of the received service search signal. In S502,the communication device determines whether or not the communicationdevice is able to provide a service required in the service searchsignal. The determination in S502 as to whether or not the communicationdevice is able to provide the service is performed by determiningwhether or not the own communication device has (supports) a function ofthe requested service.

When it is determined in S502 that the communication device does notsupport the requested service, the communication device does not respondto the service search signal or sends an error response (S507).

In contrast, when it is determined in S502 that the communication devicesupports the requested service, the communication device checks whetheror not the own communication device is executing the service (S503). Inthe case of a printing service, the state where the service is beingexecuted represents the state where any processing related to printingprocessing including processing for generating image data for printing,such as rendering and decoding of received print data, is beingexecuted, and is not necessarily the state where the actual printingprocessing on printing paper is being performed. Furthermore, in thecase of an image streaming service, not only the case where an image isbeing projected onto a display but any processing related to a streamingservice including processing for generating data for projection is alsoincluded. The above-mentioned cases are merely examples and are notintended to limit a service.

In the case where the communication device is not executing the servicein S503, since the communication device is able to accept a new serviceutilizing device, the communication device transmits a service responseindicating that the service utilizing device is acceptable, to theservice search signal (S506).

In contrast, in the case where it is determined in step S503 that theown communication device is executing the service, the communicationdevice determines whether or not the service is able to be provided to aplurality of communication devices at the same time (S504). For example,in the case of printing processing for performing printing ontorecording paper, since the service is not able to be provided at thesame time, it is determined here that the service is not able to beprovided. In contrast, in the case of projection onto a display, sincestreaming reproduction may be performed at the same time by launchingmultiple windows or dividing a screen into multiple screens, dependingon the capability or function of the display, it is determined that theservice is able to be provided.

In the case where it is determined in step S504 that the service is ableto be provided to a plurality of service utilizing devices, thecommunication device transmits a service response indicating that a newservice utilizing device is acceptable, to the service search signal(S506). In contrast, in the case where the requested service is able tobe provided to only one service utilizing device at one time, thecommunication device transmits an error response (Busy response)indicating that processing is in progress, to the service search signal(S505). Instead of the error response indicating that processing is inprogress, no response may be transmitted. Furthermore, in the case wherean error response indicating that processing is in progress istransmitted, identification information on a service utilizing devicethat is utilizing the service, may be transmitted.

As described above, according to the first embodiment, in the case wherea communication device operating as a service providing device receives,while executing a service, a request for provision of the service from adifferent communication device, the communication device makes aresponse indicating that processing is in progress, thereby preventingunnecessary service connection.

Second Embodiment

In the first embodiment, the example in which the contents of a responseto a service search signal is changed according to whether or not aservice providing device is able to provide the same service to aplurality of communication devices at the same time, has been explained.In a second embodiment, an example in which the contents of a responseto the service search signal is changed according to a user instruction,will be explained. Since the configuration of individual communicationdevices in this embodiment is similar to that in FIGS. 1 and 2 of thefirst embodiment, explanation for the configuration of the individualcommunication devices will be omitted.

FIG. 6 is a flowchart illustrating an operation of a communicationdevice according to this embodiment. Individual steps in the flowchartare performed when the controller 102 executes a program stored in thestoring unit 103.

In the flowchart of FIG. 6, processing of S501 to S503 and S505 to S507is the same as that in FIG. 5 of the first embodiment. Therefore,explanation for the processing of S501 to S503 and S505 to S507 will beomitted. Only differences from the first embodiment will be explained.

In the case where it is determined in S503 that the own communicationdevice is executing the service, the communication device displays onthe display unit 105 information indicating that a service request isreceived from a different communication device, so that a user isnotified of the information (S601). By notifying the user of theinformation, the communication device allows the user to determinewhether to accept the service request from the different communicationdevice. The user operates the operating unit 109 of the communicationdevice to instruct whether to accept the service request from thedifferent communication device.

In S602, the communication device determines, based on the instructionfrom the user, whether or not to accept the service request from thedifferent communication device.

When it is determined to accept the service request, the communicationdevice stops the service that is being executed (S603). Then, thecommunication device transmits a service response indicating that theservice request is acceptable, to the service search signal (S506).

In some cases, in order to respond to the service request from thedifferent communication device, the communication device needs todissolve the current P2P group and rearrange a new P2P group includingthe different communication device. In this case, in step S506,separation from the current P2P group may be performed.

In contrast, in the case where it is determined in step S602 that thecommunication device does not accept the service request, thecommunication device transmits an error response (Busy response)indicating that processing is in progress, to the service search signal(S606). Instead of the error response indicating that processing is inprogress, no response may be transmitted. Furthermore, in the case wherean error response indicating that processing is in progress istransmitted, identification information on a service utilizing devicethat is utilizing the service, may be transmitted.

As described above, according to the second embodiment, in the casewhere a communication device operating as a service providing devicereceives, while executing a service, a request for provision of theservice from a different communication device, the communication deviceis able to determine, in accordance with an instruction from a user,whether or not to provide the service.

Third Embodiment

In this embodiment, an example in which in the case where a serviceproviding device is requested for a service from a plurality ofcommunication devices, the contents of a response to a service searchsignal is changed according to the role in a wireless layer of theservice providing device, will be explained. Since the configuration ofindividual communication devices in this embodiment is similar to thatin FIGS. 1 and 2 of the first embodiment, explanation for theconfiguration of the communication devices will be omitted.

FIG. 7 is a flowchart illustrating an operation of a communicationdevice according to this embodiment. Individual steps in the flowchartare performed when the controller 102 executes a program stored in thestoring unit 103.

Since processing of S501 to S503 and S505 to S507 in the flowchart ofFIG. 7 is the same as that in FIG. 5 of the first embodiment,explanation for the processing of S501 to S503 and S505 to S507 will beomitted. Only differences from the first embodiment will be explained.

In the case where it is determined in S503 that the own device isexecuting the service, the communication device determines the currentrole in the wireless layer of the own device (S701). Specifically, thecommunication device determines whether the own device is currentlyoperating as a GO or a CL of Wi-Fi Direct. In the case of a GO, sincethe communication device is able to be connected with a plurality ofcommunication devices, the communication device is able to provide aservice to a plurality of communication devices. In contrast, in thecase of a CL, connection with a plurality of communication devices maybe restricted by the capability or operation policy of the device.Therefore, in the case of a CL, the communication device is not able toprovide a service to a plurality of communication devices.

In the case where it is determined in S701 that the current role of theown device is a GO, the communication device proceeds to S506, andtransmits a service response indicating the request is acceptable, tothe received service search signal.

In contrast, in the case where it is determined in S701 that the currentrole of the own device is a CL, the communication device proceeds toS505, and transmits an error response (Busy response) indicating thatprocessing is in progress, to the received service search signal.Instead of the error response indicating that processing is in progress,no response may be transmitted. Furthermore, in the case where an errorresponse indicating that processing is in progress is transmitted,identification information on a service providing device that isutilizing the service and information indicating that the own device isa CL, may be transmitted.

As described above, according to the third embodiment, in the case wherea communication device operating as a service providing device receives,while executing a service, a request for provision of the service from adifferent communication device, the communication device is able todetermine, in accordance with the role of the own device in the wirelesslayer, whether or not to provide the service.

Other Embodiments

In the individual embodiments described above are merely examples forimplementing the present invention, and various changes may be madewithout departing from the gist of the present invention. Further, theforegoing first to third embodiments may be combined together.Furthermore, a user may be able to select which one of the first tothird embodiments each communication device operates according to.

Furthermore, in the individual embodiments described above, processingperformed in the case where a communication device operating as aservice providing device receives, while executing a service, a requestfor provision of the service from a different communication device, hasbeen explained. However, the processing may be applied to the case wherea request for provision of a different service is received. For example,in the case where a service providing device receives, while executing aprinting service requested from a service utilizing device, provision ofa streaming service from a different service utilizing device, theforegoing embodiments may be applied.

The communication devices in the foregoing embodiments are notnecessarily digital cameras, printers, or the like. The communicationdevices each may be a PC, a tablet terminal, or a mobile terminal, suchas a cellular phone or a smart phone. Furthermore, the communicationdevices each may be an image processing device, such as a copyingmachine, a scanner, a facsimile machine, or a multifunction machine, ora digital home electric appliance, such as a television set or arecorder.

Further, in the foregoing embodiments, the wireless LAN conforming toIEEE 802.11 has been explained as an example. However, the presentinvention may be implemented by different wireless communication, suchas wireless USB, MBOA, Bluetooth®, UWB, or ZigBee®. Alternatively, thepresent invention may be implemented by a wire communication medium,such as a wired LAN. Here, MBOA is an abbreviation of Multi Band OFDMAlliance. UWB includes wireless USB, wireless 1394, and WINET.

Furthermore, the present invention is also implemented by performing theprocessing described below. That is, the present invention is alsoimplemented by processing of supplying software (program) implementingfunctions of the foregoing embodiments to a system or a device via anetwork or various storage media and reading and executing, with acomputer (or a CPU, an MPU, or the like) of the system or the device, aprogram code. In this case, the program and the storage medium storingthe program form the present invention.

According to the present invention, even in a case where requests forprovision of a service are received from a plurality of devices, therequests may be handled appropriately.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

The invention claimed is:
 1. A communication device capable of wirelesscommunication, comprising: a processor; and a memory coupled to theprocessor having instructions that, when executed by the processor,cause the processor to perform operations comprising: wirelesslyconnecting the communication device to a first other communicationdevice, the communication device operating as a device which establishesa wireless network or as a device which takes part in an establishedwireless network; receiving a request for print processing usingwireless communication from a second other communication devicedifferent from the first other communication device, while thecommunication device is connected to the first other communicationdevice; determining whether print processing is being performed with thefirst other communication device in a case where the request for theprint processing is received; and determining whether the communicationdevice is operating as a device which establishes a wireless network oras a device which takes part in an established wireless network; andtransmitting a response indicating that print processing is performableto the received request in a case where the first determinationdetermines that the print processing is not being performed or in a casewhere the second determination determines that the communication deviceis operating as a device which establishes a wireless network, and nottransmitting a response indicating that print processing is performableto the received request in a case where the first determinationdetermines that the print processing is being performed and the seconddetermination determines that the communication device is operating as adevice which takes part in an established wireless network.
 2. Thecommunication device according to claim 1, wherein the seconddetermination determines whether the communication device is operatingas a device which establishes a wireless network or as a device whichtakes part in an established wireless network in a case where the firstdetermination determines that the print processing is being performed.3. The communication device according to claim 1, wherein transmittingtransmits an error response to the received request in a case where thecommunication device does not support a function for performing printprocessing.
 4. The communication device according to claim 1, whereintransmitting transmits an error response to the received request in acase where the first determination determines that the print processingis being performed and the second determination determines that thecommunication device is operating as a device which takes part in anestablished wireless network.
 5. The communication device according toclaim 1, wherein the received request is a service search signal.
 6. Thecommunication device according to claim 1, wherein a role as a devicewhich establishes a wireless network is a P2P Group Owner in Wi-FiDirect standard and a role as a device which takes part in anestablished wireless network is a P2P Client in the Wi-Fi Directstandard.
 7. A control method for a communication device capable ofwireless communication, the method comprising: wirelessly connecting thecommunication device to a first other communication device, thecommunication device operating as a device which establishes a wirelessnetwork or as a device which takes part in an established wirelessnetwork; receiving a request for print processing using wirelesscommunication from a second other communication device different fromthe first other communication device, while the communication device isconnected to the first other communication device; performing a firstdetermination of determining whether print processing is being performedwith the first other communication device in a case where the requestfor the print processing is received; and performing a seconddetermination of determining whether the communication device isoperating as a device which establishes a wireless network or as adevice which takes part in an established wireless network; andtransmitting a response indicating that print processing is performableto the request received by the receiving step in a case where the firstdetermination determines that the print processing is not beingperformed or in a case where the second determination determines thatthe communication device is operating as a device which establishes awireless network, and not transmitting a response indicating that printprocessing is performable to the received request in a case where thefirst determination determines that the print processing is beingperformed and the second determination determines that the communicationdevice is operating as a device which takes part in an establishedwireless network.
 8. A non-transitory storage medium containing aprogram for causing a computer to operate as the communication deviceaccording to claim 1.